import React, { PureComponent } from "react";
import { connect } from "react-redux/es/exports";
import { RecommedWrapper, RecommedItem } from "../style";

class Recommed extends PureComponent {
  render() {
    const { recommedList } = this.props;
    return (
      <RecommedWrapper>
        {recommedList.map((item) => {
          return (
            <RecommedItem
              key={item.get("id")}
              imgUrl={item.get("imgUrl")}
            ></RecommedItem>
          );
        })}
      </RecommedWrapper>
    );
  }
}

const mapState = (state) => ({
  recommedList: state.getIn(["home", "recommendList"]),
});

export default connect(mapState, null)(Recommed);
